<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js">
    </script>
</head>
<body>
<div id="app">
    {{sex | sexFilter}}
</div>
<script>
    //创建一个过滤器
    // 1->男 0->女
    Vue.filter("sexFilter", function (val) {
        return val == 1 ? "男" : "女";
    });
    var vm = new Vue({
        el: '#app',
        data: {sex: 1},
    });
</script>
</body>
</html>